#ifndef __SLOTHTTPD_AIO_LINUX_H__
#define __SLOTHTTPD_AIO_LINUX_H__

#define _POSIX_C_SOURCE 200809L

#include <linux/aio_abi.h>
#include <syscall.h>

#ifdef __cplusplus
extern "C" {
#endif

struct timespec;

int io_setup(unsigned nr_events, aio_context_t *ctx_idp);

int io_destroy(aio_context_t ctx_id);

int io_submit(aio_context_t ctx_id, long nr, struct iocb **iocbpp);

int io_getevents(aio_context_t ctx_id, long min_nr, long nr,
                 struct io_event *events, struct timespec *timeout);

int io_cancel(aio_context_t ctx_id, struct iocb *iocbp, struct io_event *result);

#ifdef __cplusplus
} // extern "C"
#endif

#endif
